# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=undbx
pkgver=0.21.r3.g5e31c75
pkgrel=1
pkgdesc='Extract e-mail messages from Outlook Express DBX files.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-forensic')
url='https://github.com/ZungBang/undbx'
license=('GPL')
depends=()
makedepends=('git')
source=("git+https://github.com/ZungBang/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/undbx-//' | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "$pkgname"

  autoreconf -vfi
  ./configure --prefix=/usr
}

build() {
  cd "$pkgname"

  make
}

package() {
  cd "$pkgname"

  make DESTDIR="$pkgdir" install

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.rst
}

